<?php
/**
 * @author wyl
 * @date 2015-8-18 14:20:08
 */
Yii::import('application.components.cronjob.class.*');
Yii::import('application.components.auction.*');
Yii::import('dao.auction.AuctionStatus');
class ChangeStatusCommand extends Cronjob{
  	public function runBase(){
  		$liveAuctions=new AuctionStatus();
  		$endAuctions=$liveAuctions->getStatusList(1);
  		$liveAuctions=$liveAuctions->getStatusList(0);
  		if (!empty($endAuctions)) {
  			foreach ($endAuctions as $endOjb){
  				$endOjb->end();
  			}
  		}
  		
  		if (!empty($liveAuctions)) {
  			foreach ($liveAuctions as $liveObj){
  				$liveObj->start();
  			}
  		}
  	}
}